import request from '@/utils/request'

// 查询产品制程物料BOM列表
export function listRouteproductbom(query) {
  return request({
    url: '/mes/pro/routeproductbom/list',
    method: 'get',
    params: query
  })
}
// 查询产品制程物料BOM列表2
export function getProRouteItemlist(query) {
  return request({
    url: '/mes/pro/routeproductbom/getProRouteItemlist',
    method: 'get',
    params: query
  })
}

// 查询产品制程物料BOM详细
export function getRouteproductbom(recordId) {
  return request({
    url: '/mes/pro/routeproductbom/' + recordId,
    method: 'get'
  })
}

export function proBOMList(query) {
  return request({
    url: '/mes/pro/routeproductbom/routeBOMList',
    method: 'get',
    params: query
  })
}

// 新增产品制程物料BOM  
export function addRouteproductbom(data) {
  return request({
    url: '/mes/pro/routeproductbom/toAdd',
    method: 'post',
    data: data
  })
}

// 新增产品制程物料BOM  
export function addBom(data) {
  return request({
    url: '/mes/bom',
    method: 'post',
    data: data
  })
}

//批量新增
export function addRouteproductbomList(data) {
  return request({
    url: '/mes/pro/routeproductbomList',
    method: 'post',
    data: data
  })
}


// 修改产品制程物料BOM
export function updateRouteproductbom(data) {
  return request({
    url: '/mes/pro/routeproductbom',
    method: 'put',
    data: data
  })
}

// 删除产品制程物料BOM
export function delRouteproductbom(recordId) {
  return request({
    url: '/mes/pro/routeproductbom/' + recordId,
    method: 'delete'
  })
}

// 工艺路径中 删除产品制程物料BOM
export function delBom(versionsBomIds) {
  return request({
    url: '/mes/bom/' + versionsBomIds,
    method: 'delete'
  })
}

//获取模板id
export function getBomworkorder(query) {
  return request({
    url: '/mes/bom/workorder/',
    method: 'get',
    params: query
  })
}